import pymysql
def store(ss,sn):
    con = pymysql.connect(host="localhost", port=3306, user="root", password="", database="cdkb", charset="utf8")
    cursor = con.cursor()
    sql = 'insert into class(cno, cname, classroom,teacher,dayofweek,keci) values(%s,%s,%s,%s,%s,%s);'
    data = [
        (ss['id']['coureNumber'], ss['courseName'], ss['timeAndPlaceList'][0]['classroomName'],ss['attendClassTeacher'],ss['timeAndPlaceList'][0]['classDay'],ss['timeAndPlaceList'][0]['classSessions'])
    ]
    sql1='insert into studentclass(sno,cno) values(%s,%s);'
    data1={
        (sn,ss['id']['coureNumber'])
    }
    cursor.executemany(sql1, data1)
    cursor.executemany(sql, data)
    con.commit()

    cursor.close()
    con.close()
